import axios from 'axios';


export const copyWriting = async () => {
    try {
        const data = await axios.get('https://api.lolimi.cn/API/fabing/fb.php?name=Jobs');
        // console.log(data);

        return data;
    } catch (err) {
        console.log(err);
    }
};

export const copyWritingLz = async () => {
    try {
        const data = await axios.get('https://api.mg-tool.cn/v1/get_gushi/');
        return data.data.data.poem;
    } catch (err) {
        console.log(err);
    }
};

export const copyWritingSw = async () => {
    try {
        const data = await axios.get('https://api.kuleu.com/api/yiyan');
        console.log(data.data);
        return data.data;
    } catch (err) {
        console.log(err);
    }
};

export const copyWritingWy = async () => {
    try {
        const response = await axios.get('https://api.52starxi.cn/api/wy-v1/wy.php?type=text', {
            headers: {
                'User-Agent':
                    'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36',
            },
        });
        console.log(response.data);
        return response.data;
    } catch (err) {
        console.error('Error fetching data:', err);
        throw err;
    }
};